from django.contrib.auth.models import AbstractUser
from django.db import models

# Create your models here.
class UserModel(AbstractUser):
    phone = models.CharField(max_length=15,null=True,blank=True,verbose_name='手机号')
    nickname = models.CharField(max_length=50,null=True,blank=True,verbose_name='昵称',default='山海')
    avatar = models.ImageField(upload_to="avatar/%Y/%m",verbose_name='头像',default='1.jpg',null=True,blank=True)
    age = models.IntegerField(default=18,verbose_name='年龄',null=True,blank=True)
    gender = models.CharField(max_length=5,default='男',null=True,blank=True)
    money = models.DecimalField(max_digits=10,decimal_places=2,default=0.0,null=True,blank=True,verbose_name='钱')
    class Meta:
        db_table='user_model'
    def __str__(self):
        return self.nickname